package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Phone    string `gorm:"type:char(11);not null;comment:'手机号'"`
	Password string `gorm:"type:char(32);not null;comment:'密码'"`
	Status   int    `gorm:"type:int;not null;comment:状态:1-正常,2-冻结"`
}

func (u *User) Create() error {
	return DB.Create(&u).Error
}
func (u *User) GetUser(Phone string) error {
	return DB.Where("phone = ?", Phone).Limit(1).Find(&u).Error

}
